class Distance {
    double x;
    double y;

    public Distance (double _x,double _y) {      //构造器不需要参数
        x = _x;
        y = _y;
    }

    public double getDistance(Distance p) {

        return Math.sqrt((x - p.x) * (x - p.x) + (y - p.y) * (y - p.y));
    }
}


public class Mathe {
    public static void main(String[] args) {
        Distance p = new Distance(3.0,4.0);
        Distance ps = new Distance(0,0);
        System.out.println(p.getDistance(ps));
    }

}
